package com.minhua.jijiehao2.mainframe.circle.entryActivity.impl

import android.text.TextUtils
import com.minhua.jijiehao2.base.BaseMvpPresenter
import com.minhua.jijiehao2.bean.BaseBean
import com.minhua.jijiehao2.bean.CompanyIdentifyBean
import com.minhua.jijiehao2.constants.DefineKey
import com.minhua.jijiehao2.http.CallBack
import com.minhua.jijiehao2.http.ParamsMap
import com.minhua.jijiehao2.mainframe.circle.entryActivity.imp.IEntryPresenter
import com.minhua.jijiehao2.mainframe.circle.entryActivity.imp.IEntryView
import com.minhua.jijiehao2.utils.SPUtils

class EntryPresenter : BaseMvpPresenter<IEntryView>(), IEntryPresenter {

    private val mEntryModel = EntryModel()

    override fun getIdentifyStatus() {
        val userId = SPUtils.get(DefineKey.USER_ID, "") as String
        if (TextUtils.isEmpty(userId)) {
            return
        }
        val map = ParamsMap()
        map.put("userId", userId)
        mEntryModel.getIdentifyStatus(map, object : CallBack<CompanyIdentifyBean>() {
            override fun onSuccess(t: BaseBean<CompanyIdentifyBean>) {
                v?.onStatusSuccess(t.data!!)
            }
        })
    }
}